Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

account for the presence of numeric values in a vector of characters #9

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

Karim-Mane
Copy link
Member

This PR aims at addressing the following issue:

  • numeric values in a vector of characters were coerced to NA.

@Karim-Mane Karim-Mane added the bug Something isn't working label Apr 8, 2024
@Karim-Mane Karim-Mane requested a review from bahadzie April 8, 2024 12:26
@Karim-Mane Karim-Mane self-assigned this Apr 8, 2024
@bahadzie
Copy link
Member

bahadzie commented Apr 8, 2024

Thanks for catching this @Karim-Mane

Please add the test below so we never have this problem in future.

test_that("vector with number and words and NA is properly handled", {
  res <- numberize(
    c(17, "dix", "soixante-cinq", "deux mille vingt-quatre", NA),
    lang = "fr"
  )
  expect_identical(res, c(17, 10, 65, 2024, NA))
})

@bahadzie bahadzie merged commit 6645e34 into main Apr 8, 2024
7 checks passed
@bahadzie bahadzie deleted the handle_numbers_within_a_vector branch April 8, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants